home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / wfc007.000 / src / cwait.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-22  |  799 b   |  42 lines

  1. #include <wfc.h>
  2. #pragma hdrstop
  3.  
  4. /*
  5. ** Author: Samuel R. Blackburn
  6. ** CI$: 76300,326
  7. ** Internet: sammy@sed.csc.com
  8. **
  9. ** You can use it any way you like.
  10. */
  11.  
  12. #if defined( _DEBUG )
  13. #undef THIS_FILE
  14. static char BASED_CODE THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. CWaitCursor::CWaitCursor( int cursor_number )
  18. {
  19.    if ( cursor_number == 0 )
  20.    {
  21.       AfxGetApp()->BeginWaitCursor();
  22.       m_PreviousCursorHandle = NULL;
  23.    }
  24.    else
  25.    {
  26.       HCURSOR cursor_handle = AfxGetApp()->LoadCursor( cursor_number );
  27.       m_PreviousCursorHandle = ::SetCursor( cursor_handle );
  28.    }
  29. }
  30.       
  31. CWaitCursor::~CWaitCursor()
  32. {
  33.    if ( m_PreviousCursorHandle == NULL )
  34.    {
  35.       AfxGetApp()->EndWaitCursor();
  36.    }
  37.    else
  38.    {
  39.       ::SetCursor( m_PreviousCursorHandle );
  40.    }
  41. }
  42.